export default {
  data() {
    return {
      clientWidth: 375,
    }
  },
  methods: {
    goBack() {
      this.$router.back(-1);
    },
    gotoPage(toPath) {
      this.$router.push({
        //你需要接受路由的参数再跳转
        path: toPath
      });
      return false;
    },
    isPhone: function () {
      return this.clientWidth < 768;
    },
    hasFaceLogin() {
      return this.token && this.userInfo && this.userInfo.userName;
    }
  },
  mounted() {
    //初始化swiper
    // new Swiper(".swiper-container", {
    //   pagination: ".swiper-pagination",
    //   loop: true
    // });
    var that = this;
    that.clientWidth = document.body.clientWidth;

    window.onresize = (window.onresize || function () {}).after(function () {
      //console.log(1);
      that.clientWidth = document.body.clientWidth;
    });
    // $(window).resize(function() {
    //   that.clientWidth = document.body.clientWidth;
    //   console.log(that.clientWidth, that.clientWidth);
    // });
  }
}
